<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('进项发票汇总打印')" />
	<style type="text/css">
	body {
			overflow-x: auto;
		}
		table {
			font-size: 10px;
			font-weight:500;
			font-family: 线体;
			margin: auto;
	    	border-collapse: collapse;
		}
	    table, tr,td{
		    text-align: center;
		    width: 1100px;
		    height: 30px;
		}
		.items td{ height:30px; border: 1px solid black;}
		
		@media print{
		   body {
		       height: auto !important;
		   }
		}
	</style>
</head>
<body class="white-bg">
    <table style="margin-top: 0px;">
    	<input type="hidden" name="projectId" id="projectId" th:value="${projectId}"/>
		<!-- 打印网页时通过hidden-print隐藏元素 -->
	    <div class="text-right hidden-print">
	        <button class="btn btn-primary" onclick="printPage()"><i class="fa fa-print"></i> 打印</button>
	        <button class="btn btn-primary" onclick="exportExcel()"><i class="fa fa-download"></i> 导出Excel</button>
	    </div>
		<tr style="height: 60px;">
			<td style="text-align: left;font-size: 25px;font-family: 线体;font-weight:500;">
			<img style="height: 30px" src="/ruoyi.png">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			湖北鄂能电力建设有限公司【<span th:text="${head}"></span>进项发票汇总表】
			</td>
		</tr>
	</table>
	<table class="items">
		<tr>
			<td style="width: 8%" colspan="2"><b>单位名称</b></td>
			<td style="width: 63%" colspan="3" th:text="${gsmc}">&nbsp;</td>
			<td style="width: 4%" ><b>纳税人识别号</b></td>
			<td style="width: 13%" colspan="3" th:text="${sbh}">&nbsp;</td>
			<td style="width: 7%" colspan="3"><b>抵扣确认时间</b></td>
			<td style="width: 5%" colspan="2" th:text="${#dates.format(riq, 'yyyy-MM-dd')}">&nbsp;</td>
		</tr>
		<tr>
			<td><b>序号</b></td>
			<td><b>项目负责人</b></td>
			<td><b>成本类型</b></td>
			<td><b>发票对应项目</b></td>
			<td><b>开票单位名称</b></td>
			<td><b>销方税号</b></td>
			<td><b>发票类型</b></td>
			<td><b>开票时间</b></td>
			<td><b>发票号码</b></td>
			<td><b>数量</b></td>
			<td><b>税率</b></td>
			<td><b>合计金额</b></td>
			<td colspan="2"><b>抵扣税额</b></td>
		</tr>
		<tr th:each="lis,status:${replis}">
			<td style="width: 2%;" th:text="${status.count}">&nbsp;</td>
			<td style="width: 4%;" th:text="${lis.jbr}">&nbsp;</td>
			<td style="width: 5%;" th:text="${@dict.getLabel('gcgl_zf_type', lis.cblx)}">&nbsp;</td>
			<td style="width: 8%;" th:text="${lis.fpdyxm}">&nbsp;</td>
			<td style="width: 8%;" th:text="${lis.kpdwmc}">&nbsp;</td>
			<td style="width: 4%;" th:text="${lis.xfsh}">&nbsp;</td>
			<td style="width: 4%;" th:text="${lis.type}">&nbsp;</td>
			<td style="width: 5%;" th:text="${#dates.format(lis.kpsj, 'yyyy-MM-dd')}">&nbsp;</td>
			<td style="width: 4%;" th:text="${lis.fphm}">&nbsp;</td>
			<td style="width: 2%;" th:text="${lis.shul}">&nbsp;</td>
			<td style="width: 2%;" th:text="${lis.suil}">&nbsp;</td>
			<td style="width: 3%;" th:text="${lis.jine}">&nbsp;</td>
			<td colspan="2" style="width: 5%;" th:text="${lis.dkse}">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="2"><b>合计</b></td>
			<td colspan="9" th:text="${hejedx}">&nbsp;</td>
			<td th:text="${heje}">&nbsp;</td>
			<td colspan="2" th:text="${dkseje}">&nbsp;</td>
		</tr>
	</table>
	<table style="margin-top: 15px;">
		<tr>
			<td colspan="3" style="width: 14%;text-align: left;"><b>会计/出纳（签字）：</b>
				<span th:text="${kj}">&nbsp;</span>
			</td>
			<td style="width: 1%">&nbsp;</td>
			<td style="width: 10%;text-align: left;"><b>总经理（签字）：</b>
				<span th:text="${zjl}">&nbsp;</span>
			</td>
		</tr>
	</table>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        function printPage() {
            window.print();
        }
        
        function exportExcel(){
        	$.post("/gcgl/project/exportJxfp", {projectId:$("#projectId").val()}, function(result) {
                if (result.code == web_status.SUCCESS) {
                    window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
                } else if (result.code == web_status.WARNING) {
                    $.modal.alertWarning(result.msg)
                } else {
                    $.modal.alertError(result.msg);
                }
                $.modal.closeLoading();
            });
        }
    </script>
</body>
</html>